// 导入 请求文件
import { request } from '@utils/http';
import { CityType, Departments, DoctorItem, GetHospitalListTpye, PageType, ProvinceItem, ReqGetDoctorParams, ReqGetScheduleParams, } from './type';
import { FromFileType, HospitalSetItem, ReqGetHosListRespone } from '@/api/hospital/hospitalSet/type';


// 封装省份的函数
export function GetProvinceList() {
  return request.get<any, ProvinceItem[]>('/admin/cmn/dict/findByDictCode/province')
}

// 封装市的函数
export function GetCityList(id: number) {
  return request.get<any, CityType[]>(`/admin/cmn/dict/findByParentId/${id}`)
}

// 封装医院列表的函数
export function GetHospitalListData(data: PageType) {
  return request.get<any, GetHospitalListTpye>(`/admin/hosp/hospital/${data.page}/${data.limit}`)
}


// 封装获取医院的科室的函数
export function reqGetDepartments(hoscode: string) {
  return request.get<any, Departments>(`/admin/hosp/department/${hoscode}`)
}


// 封装医院某个科室的排班信息
export function reqGethospitalSchedule({ page, limit, hoscode, depcode }: ReqGetScheduleParams) {
  return request.get<any, ReqGetHosListRespone>(`/admin/hosp/schedule/getScheduleRule/${page}/${limit}/${hoscode}/${depcode}`)
}

// 获取某一天排班医生的信息
export function reqGetDoctors({ hoscode, depcode, workDate }: ReqGetDoctorParams) {
  return request.get<any, DoctorItem>(`/admin/hosp/schedule/findScheduleList/${hoscode}/${depcode}/${workDate}`)
}